package com.group525.cloudef.controller.user;


import com.group525.cloudef.common.CommonResult;
import com.group525.cloudef.entity.user.UOpinion;
import com.group525.cloudef.service.user.UOpinionService;
import com.group525.cloudef.utils.Log;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author group525
 * @since 2023-05-27
 */
@RestController
@CrossOrigin
@RequestMapping("/opinion")
public class UOpinionController {

    @Resource
    UOpinionService uOpinionService;
    @Resource
    Log log;

    @PostMapping("sendOpinion")
    public CommonResult<?>sendOpinion(@RequestBody UOpinion opinion){
        log.debug("意见反馈",opinion);
        if (uOpinionService.save(opinion)) {
            return CommonResult.success();
        }
        return CommonResult.failed();

    }


}

